3.14 \(\int x (a+b \sin (c+d x^2))^2 \, dx\)

Optimal. Leaf size=58 \[ \frac{1}{4} x^2 \left (2 a^2+b^2\right )-\frac{a b \cos \left (c+d x^2\right )}{d}-\frac{b^2 \sin \left (c+d x^2\right ) \cos \left (c+d x^2\right )}{4 d} \]

[Out]

((2*a^2 + b^2)*x^2)/4 - (a*b*Cos[c + d*x^2])/d - (b^2*Cos[c + d*x^2]*Sin[c + d*x^2])/(4*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0485753, antiderivative size = 58, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3379, 2644} \[ \frac{1}{4} x^2 \left (2 a^2+b^2\right )-\frac{a b \cos \left (c+d x^2\right )}{d}-\frac{b^2 \sin \left (c+d x^2\right ) \cos \left (c+d x^2\right )}{4 d} \]

Antiderivative was successfully verified.

[In]

Int[x*(a + b*Sin[c + d*x^2])^2,x]

[Out]

((2*a^2 + b^2)*x^2)/4 - (a*b*Cos[c + d*x^2])/d - (b^2*Cos[c + d*x^2]*Sin[c + d*x^2])/(4*d)

Rule 3379

Int[(x_)^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Sin[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Simpl
ify[(m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[(m + 1)/n], 0]))

Rule 2644

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[((2*a^2 + b^2)*x)/2, x] + (-Simp[(2*a*b*Cos[c
+ d*x])/d, x] - Simp[(b^2*Cos[c + d*x]*Sin[c + d*x])/(2*d), x]) /; FreeQ[{a, b, c, d}, x]

Rubi steps

\begin{align*} \int x \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx &=\frac{1}{2} \operatorname{Subst}\left (\int (a+b \sin (c+d x))^2 \, dx,x,x^2\right )\\ &=\frac{1}{4} \left (2 a^2+b^2\right ) x^2-\frac{a b \cos \left (c+d x^2\right )}{d}-\frac{b^2 \cos \left (c+d x^2\right ) \sin \left (c+d x^2\right )}{4 d}\\ \end{align*}

Mathematica [A]  time = 0.123084, size = 52, normalized size = 0.9 \[ -\frac{-2 \left (2 a^2+b^2\right ) \left (c+d x^2\right )+8 a b \cos \left (c+d x^2\right )+b^2 \sin \left (2 \left (c+d x^2\right )\right )}{8 d} \]

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*Sin[c + d*x^2])^2,x]

[Out]

-(-2*(2*a^2 + b^2)*(c + d*x^2) + 8*a*b*Cos[c + d*x^2] + b^2*Sin[2*(c + d*x^2)])/(8*d)

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 62, normalized size = 1.1 \begin{align*}{\frac{1}{2\,d} \left ({b}^{2} \left ( -{\frac{\cos \left ( d{x}^{2}+c \right ) \sin \left ( d{x}^{2}+c \right ) }{2}}+{\frac{d{x}^{2}}{2}}+{\frac{c}{2}} \right ) -2\,ab\cos \left ( d{x}^{2}+c \right ) +{a}^{2} \left ( d{x}^{2}+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*sin(d*x^2+c))^2,x)

[Out]

1/2/d*(b^2*(-1/2*cos(d*x^2+c)*sin(d*x^2+c)+1/2*d*x^2+1/2*c)-2*a*b*cos(d*x^2+c)+a^2*(d*x^2+c))

________________________________________________________________________________________

Maxima [A]  time = 0.984389, size = 70, normalized size = 1.21 \begin{align*} \frac{1}{2} \, a^{2} x^{2} + \frac{{\left (2 \, d x^{2} - \sin \left (2 \, d x^{2} + 2 \, c\right )\right )} b^{2}}{8 \, d} - \frac{a b \cos \left (d x^{2} + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sin(d*x^2+c))^2,x, algorithm="maxima")

[Out]

1/2*a^2*x^2 + 1/8*(2*d*x^2 - sin(2*d*x^2 + 2*c))*b^2/d - a*b*cos(d*x^2 + c)/d

________________________________________________________________________________________

Fricas [A]  time = 2.04341, size = 119, normalized size = 2.05 \begin{align*} \frac{{\left (2 \, a^{2} + b^{2}\right )} d x^{2} - b^{2} \cos \left (d x^{2} + c\right ) \sin \left (d x^{2} + c\right ) - 4 \, a b \cos \left (d x^{2} + c\right )}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sin(d*x^2+c))^2,x, algorithm="fricas")

[Out]

1/4*((2*a^2 + b^2)*d*x^2 - b^2*cos(d*x^2 + c)*sin(d*x^2 + c) - 4*a*b*cos(d*x^2 + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.607337, size = 95, normalized size = 1.64 \begin{align*} \begin{cases} \frac{a^{2} x^{2}}{2} - \frac{a b \cos{\left (c + d x^{2} \right )}}{d} + \frac{b^{2} x^{2} \sin ^{2}{\left (c + d x^{2} \right )}}{4} + \frac{b^{2} x^{2} \cos ^{2}{\left (c + d x^{2} \right )}}{4} - \frac{b^{2} \sin{\left (c + d x^{2} \right )} \cos{\left (c + d x^{2} \right )}}{4 d} & \text{for}\: d \neq 0 \\\frac{x^{2} \left (a + b \sin{\left (c \right )}\right )^{2}}{2} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sin(d*x**2+c))**2,x)

[Out]

Piecewise((a**2*x**2/2 - a*b*cos(c + d*x**2)/d + b**2*x**2*sin(c + d*x**2)**2/4 + b**2*x**2*cos(c + d*x**2)**2
/4 - b**2*sin(c + d*x**2)*cos(c + d*x**2)/(4*d), Ne(d, 0)), (x**2*(a + b*sin(c))**2/2, True))

________________________________________________________________________________________

Giac [A]  time = 1.11968, size = 77, normalized size = 1.33 \begin{align*} \frac{4 \,{\left (d x^{2} + c\right )} a^{2} +{\left (2 \, d x^{2} + 2 \, c - \sin \left (2 \, d x^{2} + 2 \, c\right )\right )} b^{2} - 8 \, a b \cos \left (d x^{2} + c\right )}{8 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*sin(d*x^2+c))^2,x, algorithm="giac")

[Out]

1/8*(4*(d*x^2 + c)*a^2 + (2*d*x^2 + 2*c - sin(2*d*x^2 + 2*c))*b^2 - 8*a*b*cos(d*x^2 + c))/d